package com.tina.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tina.entity.Common;
import com.tina.mapper.CommonMapper;
import com.tina.service.ICommonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 商品表 服务实现类
 * </p>
 *
 * @author Tina
 * @since 2020-10-26
 */
@Service
public class CommonServiceImpl extends ServiceImpl<CommonMapper, Common> implements ICommonService {

    @Autowired
    private CommonMapper commonMapper;

    @Override
    public List<Common> selectCommon(Long flowersId) {
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq("food_id", flowersId);
        queryWrapper.eq("parent_id", 0);
        return commonMapper.selectList(queryWrapper);
    }
}
